<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>放映厅场次管理 - 影院管理系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f5f5;
            line-height: 1.6;
        }
        
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 1rem 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        
        .nav {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }
        
        .logo {
            font-size: 24px;
            font-weight: bold;
        }
        
        .nav-links {
            display: flex;
            gap: 30px;
        }
        
        .nav-links a {
            color: white;
            text-decoration: none;
            font-weight: 500;
            transition: opacity 0.3s;
        }
        
        .nav-links a:hover {
            opacity: 0.8;
        }
        
        .nav-links a.active {
            opacity: 1;
            border-bottom: 2px solid white;
            padding-bottom: 2px;
        }
        
        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .page-header {
            background: white;
            padding: 30px;
            border-radius: 15px;
            margin-bottom: 30px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .page-title {
            font-size: 28px;
            color: #333;
            margin: 0;
        }
        
        .btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            font-size: 14px;
            font-weight: 500;
            transition: transform 0.2s;
        }
        
        .btn:hover {
            transform: translateY(-2px);
        }
        
        .btn-sm {
            padding: 6px 12px;
            font-size: 12px;
        }
        
        .btn-outline {
            background: transparent;
            border: 2px solid #667eea;
            color: #667eea;
        }
        
        .btn-outline:hover {
            background: #667eea;
            color: white;
        }
        
        .alert {
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 8px;
            border-left: 4px solid #dc3545;
            background-color: #f8d7da;
            color: #721c24;
        }
        
        .room-info-section {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
            margin-bottom: 30px;
        }
        
        .room-info-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
        }
        
        .room-info-item {
            text-align: center;
            padding: 20px;
            border: 1px solid #e1e1e1;
            border-radius: 10px;
        }
        
        .room-info-icon {
            font-size: 32px;
            margin-bottom: 10px;
            color: #667eea;
        }
        
        .room-info-label {
            font-size: 14px;
            color: #666;
            margin-bottom: 5px;
        }
        
        .room-info-value {
            font-size: 24px;
            font-weight: bold;
            color: #333;
        }
        
        .screenings-section {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        .section-title {
            font-size: 24px;
            color: #333;
            margin-bottom: 20px;
            border-bottom: 3px solid #667eea;
            padding-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .screenings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
        }
        
        .screening-card {
            border: 1px solid #e1e1e1;
            border-radius: 10px;
            padding: 20px;
            transition: transform 0.3s, box-shadow 0.3s;
            border-left: 4px solid #667eea;
        }
        
        .screening-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        }
        
        .screening-title {
            font-size: 18px;
            font-weight: bold;
            color: #667eea;
            margin-bottom: 15px;
        }
        
        .screening-info {
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: #666;
            font-size: 14px;
        }
        
        .screening-price {
            font-size: 16px;
            font-weight: bold;
            color: #28a745;
            margin-bottom: 15px;
        }
        
        .status-badge {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            margin-bottom: 15px;
            display: inline-block;
        }
        
        .status-upcoming {
            background-color: #e3f2fd;
            color: #1976d2;
        }
        
        .status-playing {
            background-color: #fff3e0;
            color: #f57c00;
        }
        
        .status-finished {
            background-color: #f3e5f5;
            color: #7b1fa2;
        }
        
        .no-data {
            text-align: center;
            color: #666;
            font-style: italic;
            padding: 60px;
        }
        
        .no-data-icon {
            font-size: 64px;
            color: #ccc;
            margin-bottom: 20px;
        }
        
        .recent-activities {
            background: white;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .activity-item {
            display: flex;
            align-items: center;
            padding: 15px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-content {
            flex: 1;
            margin-left: 15px;
        }

        .activity-title {
            font-weight: 600;
            color: #333;
            margin-bottom: 5px;
        }

        .activity-time {
            color: #666;
            font-size: 0.9em;
        }

        .activity-type {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8em;
            font-weight: 500;
        }

        .activity-type.user { background: #e3f2fd; color: #1976d2; }
         .activity-type.order { background: #f3e5f5; color: #7b1fa2; }
         .activity-type.system { background: #e8f5e8; color: #388e3c; }

         /* 放映厅信息样式 */
         .room-info-section {
             background: white;
             border-radius: 12px;
             padding: 25px;
             margin-bottom: 30px;
             box-shadow: 0 2px 10px rgba(0,0,0,0.1);
         }

         .room-info-grid {
             display: grid;
             grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
             gap: 20px;
         }

         .room-info-item {
             text-align: center;
             padding: 20px;
             background: #f8f9fa;
             border-radius: 8px;
         }

         .room-info-icon {
             font-size: 2em;
             margin-bottom: 10px;
         }

         .room-info-label {
             color: #666;
             font-size: 0.9em;
             margin-bottom: 5px;
         }

         .room-info-value {
             font-size: 1.2em;
             font-weight: 600;
             color: #333;
         }

         /* 场次列表样式 */
         .screenings-section {
             background: white;
             border-radius: 12px;
             padding: 25px;
             box-shadow: 0 2px 10px rgba(0,0,0,0.1);
         }

         .screenings-section h2 {
             margin-bottom: 25px;
             color: #333;
             font-size: 1.5em;
         }

         .empty-state {
             text-align: center;
             padding: 50px 20px;
             color: #666;
         }

         .empty-icon {
             font-size: 4em;
             margin-bottom: 20px;
         }

         .screenings-grid {
             display: grid;
             grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
             gap: 20px;
         }

         .screening-card {
             background: #f8f9fa;
             border-radius: 8px;
             padding: 20px;
             border: 1px solid #e9ecef;
             transition: transform 0.2s, box-shadow 0.2s;
         }

         .screening-card:hover {
             transform: translateY(-2px);
             box-shadow: 0 4px 15px rgba(0,0,0,0.1);
         }

         .screening-title {
             font-size: 1.1em;
             font-weight: 600;
             color: #333;
             margin-bottom: 15px;
         }

         .screening-info {
             margin-bottom: 10px;
             color: #666;
         }

         .screening-price {
             font-size: 1.1em;
             font-weight: 600;
             color: #28a745;
             margin-bottom: 15px;
         }

         .status-badge {
             display: inline-block;
             padding: 4px 12px;
             border-radius: 20px;
             font-size: 0.8em;
             font-weight: 500;
             margin-bottom: 15px;
         }

         .status-upcoming { background: #e3f2fd; color: #1976d2; }
         .status-playing { background: #fff3e0; color: #f57c00; }
         .status-finished { background: #f3e5f5; color: #7b1fa2; }

         .btn-sm {
             padding: 6px 12px;
            font-size: 12px;
         }

         .btn-sm:hover {
             background: #0056b3;
             color: white;
             text-decoration: none;
         }

         .alert {
             background: #fff3cd;
             color: #856404;
             padding: 15px;
             border-radius: 8px;
             margin-bottom: 20px;
             border: 1px solid #ffeaa7;
         }
     </style>
</head>
<body>
    <header class="header">
        <nav class="nav">
            <div class="logo">🎬 管理员控制台</div>
            <div class="nav-links">
                <a href="/admin/dashboard">控制台</a>
                <a href="/admin/users">用户管理</a>
                <a href="/admin/rooms" class="active">放映厅管理</a>
                <a href="/admin/logs">系统日志</a>
            </div>
            <div class="user-info">
                <span th:text="'管理员：' + ${currentUser != null ? currentUser.username : '未登录'}">管理员</span>
                <a href="/auth/logout" class="btn btn-sm">退出登录</a>
            </div>
        </nav>
    </header>
    
    <div class="container">
        <div class="page-header">
            <h1 class="page-title">
                🎬 <span th:text="${room != null ? room.name + ' - 场次管理' : '放映厅场次管理'}">放映厅场次管理</span>
            </h1>
            <a th:href="@{/admin/rooms}" class="btn btn-outline">
                ← 返回放映厅列表
            </a>
        </div>

        <!-- 错误提示 -->
        <div th:if="${error}" class="alert">
            ⚠️ <span th:text="${error}">错误信息</span>
        </div>

        <!-- 场次列表 -->
        <div class="screenings-section">
            <h2 class="section-title">
                🎬 场次列表
            </h2>
            
            <div th:if="${#lists.isEmpty(screenings)}" class="no-data">
                <div class="no-data-icon">📅</div>
                <p>该放映厅暂无场次安排</p>
            </div>
            
            <div th:if="${!#lists.isEmpty(screenings)}" class="screenings-grid">
                <div th:each="screening : ${screenings}" class="screening-card">
                    <div class="screening-title" th:text="${screening.movie != null ? screening.movie.title : '未知电影'}">电影标题</div>
                    
                    <div class="screening-info">
                        🕐 <span th:text="${screening.startTime != null ? #temporals.format(screening.startTime, 'yyyy-MM-dd HH:mm') : '未知时间'}">开始时间</span>
                    </div>
                    
                    <div class="screening-info">
                        ⏱️ <span th:text="${screening.movie != null and screening.movie.duration != null ? screening.movie.duration + ' 分钟' : '未知时长'}">时长</span>
                    </div>
                    
                    <div class="screening-price">
                        💰 ¥<span th:text="${screening.price != null ? screening.price : '0.00'}">价格</span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>